package com.cc.services.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.cc.daos.UserMapper;
import com.cc.models.User;
import com.cc.services.UserServiceI;

@Service("userService")
@Transactional
public class UserServiceImpl implements UserServiceI{

	@Autowired
	private UserMapper userMapper;
	
	@Override
	public List<User> findAll() {
		return userMapper.findAll();
	}

	@Override
	public void addUser(User user) {
		userMapper.addUser(user);
	}

	@Override
	public void delUserById(Integer userId) {
		userMapper.delUser(userId);
	}

	@Override
	public User findUserById(Integer userId) {
		return userMapper.findUserById(userId);
	}

	@Override
	public void updateUser(User user) {
		userMapper.updateUser(user);
	}

	@Override
	public List<User> findUserByParam(Map params) {
		return userMapper.findUserByParam(params);
	}

	@Override
	public List<User> findUserWithPage(Map params) {
		return userMapper.findUserWithPage(params);
	}

	@Override
	public int countByParams(Map params) {
		return userMapper.countByParams(params);
	}

}
